<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <link href="../../js/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="footer.css"/>
    <link rel="stylesheet" href="../../css/lystyle.css" />
    <style type="text/css">
        /*修改底部字体颜色*/
        .foot:nth-child(2){
            color: #e83023;
        }
        .main{
        	padding: 0.347222rem 0.402777rem 0.347222rem 0.402777rem;
       		background-color: #FFFFFF;
        }
        #main_top{
        	height: 1.152777rem;
        	border-bottom: 0.013888rem solid #dbdbdb;
        }
        #img{
        	float: left;
        	width: 0.916666rem;
        	margin-right: 0.416666rem;
        }
        #assessPer{
        	float: left;
        	width: 5.555555rem;
        	font-size: 0.416666rem;
        }
        #assessMain{
        	width: 100%;
        	height: 4.097222rem;
        	border: 0;
        	margin-top: 0.347222rem;
        	resize:none;
        	outline: none;
        }
        #assessMain:focus{
        	border: 0;
        }
    </style>
    <script src="../../js/flexible.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id="wrap">
    <div id="main">
        <div id="header">
            <a id="headImg" href="javascript:history.go(-1)"><img class="headImg" src="../../images/12.png"/></a>
            <a id="headRightImage" style="color: #e83023; border: 0.013888rem solid #e83023; font-size: 0.347222rem; border-radius: 0.277777rem;padding: 0 0.208333rem;" >提交</a>					
            <p id="headTitle">评价商家</p>
        </div>
        <div id="content">
           <div class="main">
           		<div id="main_top">
           			<img id="img" src="../../images/store/maijia1.png" alt="urlError"/>
           			<p id="assessPer" >  </p>
           		</div>
           		<textarea id="assessMain" maxlength="50" name="" rows="" cols="" placeholder="请输入评价内容"></textarea>
          		<p style="text-align: right;">剩余字数：<span id="zishu">50</span></p>
           </div>

           
        </div>
    </div>
</div>
</body>
<script src="../../js/jquery-2.2.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
		$(document).ready(function(){
		//调用参数函数
		function GetQueryString(key){
   		 // 获取参数
    	var url = window.location.search;
   		 // 正则筛选地址栏
    	var reg = new RegExp("(^|&)"+ key +"=([^&]*)(&|$)");
    	// 匹配目标参数
    	var result = url.substr(1).match(reg);
    	//返回参数值
   		 return result ? decodeURIComponent(result[2]) : null;
}	
			
			$("#img").attr("src",GetQueryString('shopPic'));
			$("#assessPer").html(GetQueryString('shopName'));
			var orderSn = GetQueryString('orderSn');
			$("#headRightImage").click(function(){
				if ($("#assessMain").val() != '') {
					alert($("#assessMain").val())
				
				$.ajax({
					type:"put",
					url:"http://47.104.13.109/mall-service/assess/insert",
					async:true,
					data:{
						memberId : $.cookie("memberId"),
						memberName : GetQueryString('memberName'),
						memberNumber : GetQueryString('memberName') ,
						goodsId : GetQueryString('goodsId'),
						shopId : GetQueryString('shopId'),
						shopName: GetQueryString('shopName'),
						shopNumber : GetQueryString('shopNumber'),
						assessContent : $("#assessMain").val()
					},
					success:function(data){
						alert("评价成功");
						history.go(-1);
					}
				});
				}else{
					alert("请输入评价内容");
				}
			})
			
		})
		$("#assessMain").keyup(function(){
			if ($("#assessMain").val().length >= 50) {
				$("#assessMain").val().length = 50;
			}
			$("#zishu").html(50-$("#assessMain").val().length);
		})
</script>
</html>